#include "stdafx.h"
#include "Fakes/FakeD3D10Device.h"
#include "Fakes/FakeD3D10Query.h"

DESCRIPTION_10_TEST_SUITE_CTOR(QueryDescription, (D3D10_QUERY_EVENT))

BOOST_FIXTURE_TEST_CASE(Default, TestQueryDescription)
{
	BOOST_REQUIRE_EQUAL(D3D10_QUERY_EVENT, m_desc.Query);
	BOOST_REQUIRE_EQUAL(0, m_desc.MiscFlags);
}

DESCRIPTION_10_TEST_CASE(UINT, MiscFlags, D3D10_RESOURCE_MISC_SHARED, QueryDescription)

BOOST_FIXTURE_TEST_CASE(Create, TestQueryDescription)
{
	FakeD3D10Device device;
	FakeD3D10Query query;
	device.CreateQueryFakeResult = &query;
	device.CreateQueryFakeHResult = S_OK;
	ID3D10Query *result = m_desc.Create(&device);
	BOOST_REQUIRE(device.CreateQueryCalled);
	BOOST_REQUIRE_EQUAL(&m_desc, device.CreateQueryLastDesc);
	BOOST_REQUIRE_EQUAL(&query, result);
}

BOOST_AUTO_TEST_SUITE_END()
